class Solution {
private:
    multiset<char> set;
public:
    bool isAnagram(string s, string t) {
        for(char item : s){
            this->set.insert(item);
        }

        for(char item : t){
            auto it = this->set.find(item);
            if(it == this->set.end()){
                return false;
            } else {
                this->set.erase(it);
            }
        }

        if(this->set.empty()){
            return true;
        } else {
            return false;
        }
        
    }
};